home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
gnu
/
include
/
incl98.zoo
/
falcon.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-05
|
19KB
|
636 lines
/*
* GNU-C Bindings for Falcon XBIOS functions
* -- hyc 11-9-92 (uunet!hanauma.Jpl.Nasa.Gov!hyc)
*/
#ifndef _FALCON_H
#define _FALCON_H
#ifndef _OSBIND_H
#include <osbind.h>
#endif
#ifdef __LATTICE__
#define __F_TRAP {register d2,a2; "4e4e";}
void _vfv(int);
char _bfv(int);
short _sfv(int);
long _lfv(int);
void _vfs(int, int);
short _sfs(int, int);
long _lfs(int, int);
void _vfss(int, int, int);
long _lfss(int, int, int);
void _vfll(int, long, long);
void _vflp(int, long, void *);
void _vfssr(int, int, int, long *);
void _vfssR(int, int, int, const long *);
void _vfpls(int, void *, long, int);
short _sflsp(int, long, int, void *);
short _sfpls(int, void *, long, int);
long _lfspp(int, int, void *, void *);
short _sfppss(int, void *, void *, int, int);
void _vfllpp(int, long, long, void *, void *);
void _vfplll(int, void *, long, long, long);
void _vfplpl(int, void *, long, void *, long);
long _lfsssss(int, int, int, int, int, int);
void _vfppllll(int, void *, void *, long, long, long, long);
#pragma inline _vfv((short)) __F_TRAP
#pragma inline d0=_bfv((short)) __F_TRAP
#pragma inline d0=_sfv((short)) __F_TRAP
#pragma inline d0=_lfv((short)) __F_TRAP
#pragma inline _vfs((short),(short)) __F_TRAP
#pragma inline d0=_sfs((short),(short)) __F_TRAP
#pragma inline d0=_lfs((short),(short)) __F_TRAP
#pragma inline _vfss((short),(short),(short)) __F_TRAP
#pragma inline d0=_lfss((short),(short),(short)) __F_TRAP
#pragma inline _vfll((short),,) __F_TRAP
#pragma inline _vflp((short),,) __F_TRAP
#pragma inline _vfssr((short),(short),(short),) __F_TRAP
#pragma inline _vfssR((short),(short),(short),) __F_TRAP
#pragma inline _vfpls((short),,,(short)) __F_TRAP
#pragma inline d0=_sfpls((short),,,(short)) __F_TRAP
#pragma inline d0=_sflsp((short),,(short),) __F_TRAP
#pragma inline d0=_lfspp((short),(short),,) __F_TRAP
#pragma inline d0=_sfppss((short),,,(short),(short)) __F_TRAP
#pragma inline _vfllpp((short),,,,) __F_TRAP
#pragma inline _vfplll((short),,,,) __F_TRAP
#pragma inline _vfplpl((short),,,,) __F_TRAP
#pragma inline d0=_lfsssss((short),(short),(short),(short),(short),(short)) __F_TRAP
#pragma inline _vfppllll((short),,,,,) __F_TRAP
#else /* !__LATTICE__ */
#ifndef trap_14_wwwwww
#if __GNUC__ > 1
#define trap_14_wwwwww(n,a,b,c,d,e) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
short _b = (short)(b); \
short _c = (short)(c); \
short _d = (short)(d); \
short _e = (short)(e); \
\
__asm__ volatile \
("\
movw %6,sp@-; \
movw %5,sp@-; \
movw %4,sp@-; \
movw %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(12),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e) \
: "d0", "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#else
#define trap_14_wwwwww(n,a,b,c,d,e) \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
short _b = (short)(b); \
short _c = (short)(c); \
short _d = (short)(d); \
short _e = (short)(e); \
\
__asm__ volatile \
("\
movw %4,sp@-; \
movw %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
movw %0,sp@- " \
:: "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e)); \
\
__asm__ volatile \
("\
movw %1,sp@-; \
trap #14; \
lea sp@(12),sp" \
: "=r"(retvalue) \
: "g"(n) \
: "d0", "d1", "d2", "a0", "a1", "a2"); \
retvalue; \
})
#endif
#endif
#ifndef trap_14_wllll
#define trap_14_wllll(n,a,b,c,d) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
\
__asm__ volatile \
("\
movl %5,sp@-; \
movl %4,sp@-; \
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(18),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d) \
: "d0", "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wllllll
#define trap_14_wllllll(n,a,b,c,d,e,f) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
long _e = (long)(e); \
long _f = (long)(f); \
\
__asm__ volatile \
("\
movl %7,sp@-; \
movl %6,sp@-; \
movl %5,sp@-; \
movl %4,sp@-; \
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(26),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e), "r"(_f) \
: "d0", "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wll
#define trap_14_wll(n,a,b) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
\
__asm__ volatile \
("\
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(10),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b) \
: "d0", "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wlwl
#define trap_14_wlwl(n,a,b,c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
short _b = (short)(b); \
long _c = (long)(c); \
\
__asm__ volatile \
("\
movl %4,sp@-; \
movw %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(12),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) \
: "d0", "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#endif /* __LATTICE__ */
/*
* Video
*/
/* Video mode codes */
#define VERTFLAG 0x100 /* double-line on VGA, interlace on ST/TV */
#define STMODES 0x080 /* ST compatible */
#define OVERSCAN 0x040 /* Multiply X&Y rez by 1.2, ignored on VGA */
#define PAL 0x020 /* PAL if set, else NTSC */
#define VGA 0x010 /* VGA if set, else TV mode */
#define COL80 0x008 /* 80 column if set, else 40 column */
#define NUMCOLS 7 /* Mask for number of bits per pixel */
#define BPS16 4
#define BPS8 3
#define BPS4 2
#define BPS2 1
#define BPS1 0
/* Montype return values */
enum montypes {STmono=0, STcolor, VGAcolor, TVcolor};
/* VsetSync flags - 0=internal, 1=external */
#define VID_CLOCK 1
#define VID_VSYNC 2
#define VID_HSYNC 4
#undef Setscreen
#ifdef __LATTICE__
#define Setscreen(a, b, c, d) _sfppss(5, a, b, c, d)
#define Vsetmode(a) _sfs(88, a)
#define Montype() _sfv(89)
#define VsetSync(a) _vfs(90)
#define VgetSize(a) _lfs(91)
#define VsetRGB(a, b, c) _vfssR(93, a, b, c)
#define VgetRGB(a, b, c) _vfssr(94, a, b, c)
#define VsetMask(a, b) _vfss(150, a, b)
#else /* !__LATTICE__ */
#define Setscreen(lscrn,pscrn,rez,mode) \
(short)trap_14_wllww((short)5,(long)(lscrn),(long)(pscrn), \
(short)(rez),(short)(mode))
#define Vsetmode(mode) \
(short)trap_14_ww((short)88,(short)(mode))
#define Montype() \
(short)trap_14_w((short)89)
#define VgetSize(mode) \
(long)trap_14_ww((short)91,(short)(mode))
#define VsetSync(ext) \
(void)trap_14_ww((short)90,(short)(ext))
#define VsetRGB(index,count,array) \
(void)trap_14_wwwl((short)93,(short)(index),(short)(count), \
(long *)(array))
#define VgetRGB(index,count,array) \
(void)trap_14_wwwl((short)94,(short)(index),(short)(count), \
(long *)(array))
#define VsetMask(andmask,ormask) \
(short)trap_14_www((short)150,(short)(andmask),(short)(ormask))
#endif /* __LATTICE__ */
/*
* Sound
*/
/* _SND cookie values */
#define SND_PSG 0x01 /* Yamaha PSG */
#define SND_8BIT 0x02 /* 8 bit DMA stereo */
#define SND_16BIT 0x04 /* 16 bit CODEC */
#define SND_DSP 0x08 /* DSP */
#define SND_MATRIX 0x10 /* Connection Matrix */
/* XXX Docs say Falcon shows 0x3f. What does bit 0x20 mean ??? */
/*
* Sound data memory layout - samples are all signed values
*
* (each char = 1 byte, 2 chars = 1 word)
* 1 16 bit stereo track: LLRRLLRRLLRRLLRR
* 1